package IntegerTest;
/*
String int Integer之间互相转换
 */
public class IntegerTest3 {
    public static void main(String[] args){
        //String ---> int
        String s = "123";
        int i = Integer.parseInt(s);
        System.out.println(i+1);//124
        //int ---> String
        int i1 = 100;
        String s1 = String.valueOf(i1);
        System.out.println(s1+1);

        //int ---> Integer(自动装箱)
        int i2 = 100;
        Integer it = i2;
        System.out.println(it);
        //Integer ---> int(自动拆箱)
        int i3 = it;

        //String ---> Integer
        String s2 = "123";
        Integer it1 = Integer.valueOf(s2);
        System.out.println(it1+1); //124
        //Integer ---> String
        Integer it2 = 100;
        String s3 = String.valueOf(it2);
        System.out.println(s3+1); //1001
    }
}
